<?
include('../inst.conf.php');
$this_Path= "http://".$_SERVER['HTTP_HOST'].substr( $_SERVER['SCRIPT_NAME'], 0, (strrpos($_SERVER['SCRIPT_NAME'],"/")+1));

if(isset($_GET['nieuw'])){
	$myFile = "Nieuwe_gebruiker.html";
	
}elseif(isset($_GET['nieuwadmin'])){
	$myFile = "Nieuwe_admin.html";

}elseif(isset($_GET['nowadmin'])){
	$myFile = "nu_admin.html";

}elseif(isset($_GET['wachtwoord'])){
	$myFile = "Nieuw_wachtwoord.html";
	
}elseif(isset($_GET['wachtwoord2'])){
	$myFile = "Nieuw_wachtwoord 2.html";
	
}


	$fh = fopen($myFile, 'r');
	$theData = fread($fh, filesize($myFile));
	fclose($fh);

	$theData= str_replace("%pathtofile%", $this_Path, $theData);
	$theData= str_replace("%date%", date('d ').$cfg['general']['maand_naam'][(int)date('m')].date(' Y H:i'), $theData);
	$theData= str_replace("%name%", "Laurens", $theData);
	$theData= str_replace("%adminname%", "Wilbert Koelewijn", $theData);
	$theData= str_replace("%code%", "fR1wayXU", $theData);
	$theData= str_replace("%username%", "LauLaman", $theData);
	$theData= str_replace("%password%", "Z5b20Ze0e6iBAZDxxjH5", $theData);
	$theData= str_replace("%hash1%", "822ff3241b7f058fd234266f989155c0ebc64be5", $theData);
	$theData= str_replace("%hash2%", "efa76b9e2e46b9bc9309baf7ce1ff7bd09032592", $theData);
	$theData= str_replace("%disclaimer%", $cfg['mail']['disclaimer'], $theData);



$to = 'laurens.laman@llaman.nl';

$subject = 'Nieuw wachtwoord!';


$headers = "From: ".$cfg['mail']['from']."\r\n";
$headers .= "Reply-To: ".$cfg['mail']['reply_to']."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
//mail($to, $subject, $theData, $headers);echo "verzonden!<br>";
echo $theData;
 
?>